package com.aims.logic.example.controller;

import com.aims.logic.runtime.service.LogicRunnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataApi {
    @Autowired
    private LogicRunnerService logic;
    @PostMapping("/api/data/{logicId}")
    public Object runLogic(@PathVariable String logicId, @RequestBody String body) {
        return logic.runByJson(logicId, body);
    }
}
